﻿@namespace MudBlazor.UnitTests.TestComponents

<MudChipSet T="string" @bind-SelectedValues="_selectedValues" SelectionMode="SelectionMode.MultiSelection" CheckMark>
    @if (_extraItem)
    {
        <MudChip Value="@("Extra Chip")" Default="true" />
    }
    <MudChip Value="@("Primary")" Default="true"/>
</MudChipSet>
Add chips <MudIconButton Icon="@Icons.Material.Filled.Add" OnClick="Enable">Enable</MudIconButton>

<br />
@if (_selectedValues is { Count: > 0 }) {
    <MudText>@string.Join(", ", _selectedValues.OrderBy(x => x))</MudText>
}
else {
    <MudText>Nothing selected</MudText>
}

@code
{ 
    bool _extraItem = false;
    public void Enable() => _extraItem = !_extraItem;
    IReadOnlyCollection<string> _selectedValues;
}